package com.itheima.map;

import java.util.HashMap;
import java.util.Hashtable;

public class Demo02 {

    public static void main(String[] args) throws InterruptedException {
        Hashtable<String, String> map = new Hashtable<>();

        new Thread(() -> {
            for (int i = 1; i <= 500; i++) {
                map.put(i + "", i + "");
            }
        }).start();
        new Thread(() -> {
            for (int i = 501; i <= 1000; i++) {
                map.put(i + "", i + "");

            }
        }).start();
        Thread.sleep(1000);
        for (int i = 1; i <=1000; i++) {
            System.out.println(i+"====="+map.get(i + ""));
        }


    }

}
